import { domainService } from '~/config/server'
import { NetService } from '~/utils/net.service'
import { Inject, Debounce } from "~/core/decorator";

export class QueueService {
  @Inject(NetService)
  private netService: NetService
  /**
   * 新增队列
   */
  public add(data) {
    return this.netService.send({
      server: domainService.queueManageController.add,
      data,
      loading: true
    })
  }
  /**
   * 经办设置
   */
  public handlerSetting(data) {
    return this.netService.send({
      server: domainService.queueManageController.handlerSetting,
      data,
      loading: true
    })
  }
  /**
   * 根据队列id查看队列下的经办人
   */
  public viewHandlerMessage(data) {
    return this.netService.send({
      server: domainService.queueManageController.viewHandlerMessage,
      data
    })
  }
  /**
   * 修改队列信息
   */
  public update(data) {
    return this.netService.send({
      server: domainService.queueManageController.update,
      data,
      loading: true
    })
  }
  /**
   * 停用队列
   */
  public updateStatus(data) {
    return this.netService.send({
      server: domainService.queueManageController.updateStatus,
      data,
      loading: true
    })
  }
  /**
   * 查询所有日期策略
   */
  public queryAllDateStrategy() {
    return this.netService.send({
      server: domainService.queueManageController.queryAllDateStrategy,
    })
  }
  /**
   * 查询所有日期策略(启用和停用)
   */
  public queryAllDateStrategy1() {
    return this.netService.send({
      server: domainService.queueManageController.queryAllDateStrategy1,
    })
  }
  /**
   * 分页查询队列信息
   */
  public getAllCaseQueue(data, page, sort) {
    return this.netService.send({
      server: domainService.queueManageController.getAllCaseQueue,
      data,
      loading: true,
      page,
      sort,
    })
  }
  /**
   * 根据id查询详情
   */
  public view(data) {
    return this.netService.send({
      server: domainService.queueManageController.view,
      data,
      loading: true,
    })
  }
  /**
   * 根据id查询队列案件详情
   */
  public getAllQueueCases(data,page) {
    return this.netService.send({
      server: domainService.queueManageController.getAllQueueCases, 
      data,
      loading: true,
      page,
    })
  }
  /**
   * 根据id查询查询队列修改信息
   */
  public getAllQueueModifyLogs(data,page) {
    return this.netService.send({
      server: domainService.queueManageController.getAllQueueModifyLogs, 
      data,
      loading: true
    })
  }
  /**
   * 根据id查询轻渠道详情
   */
  public getTagApplyById(data,page) {
    return this.netService.send({
      server: domainService.queueManageController.getQueueBusinessMessage, 
      data,
      loading: true,
      page,
    })
  }
  /**
   * 分案下一步
   */
  public telTransferCaseNext(data) {
    return this.netService.send({
        server: domainService.queueManageController.distributeCaseNext,
        data,
        loading: true,
    })
  }
  /**
   * 分案确定
   */
  public telTransferCaseConfirm(data) {
    return this.netService.send({
        server: domainService.queueManageController.distributeCaseConfirm,
        data,
        loading: true,
    })
  }
}